//
//  WZC_TableViewHeaderFooterView.swift
//  XMYouPin
//
//  Created by 王宗成 on 2019/7/25.
//  Copyright © 2019 王宗成. All rights reserved.
//

import UIKit

class WZC_TableViewHeaderFooterView: UITableViewHeaderFooterView {

    var block:WZC_CommonBlock?
    
    //标题
    lazy var titleLable: UILabel = {
        
        let InnerTitleLable = UILabel(frame: CGRect.init(x: 0, y: 0, width: 10, height: 20))
        self.contentView.addSubview(InnerTitleLable)
        
        InnerTitleLable.snp.makeConstraints({ (make) in
            
            make.centerY.equalTo(self.snp_centerY)
            make.left.equalTo(15)
        })
        
        return InnerTitleLable
    }()
    
    //子标题
    lazy var subTitleLable: UILabel = {
        
        let InnerTitleLable = UILabel(frame: CGRect.init(x: 0, y: 0, width: 10, height: 20))
        self.contentView.addSubview(InnerTitleLable)
        return InnerTitleLable
    }()
    
    //按钮
    lazy var commonBtn1: UIButton = {
        
        let button = UIButton()
        self.contentView.addSubview(button)
        button.addTarget(self, action: #selector(buttonAction), for: .touchUpInside)
        return button
    }()
    
    @objc func buttonAction(){
        
        if let tBlock = block {
            
            tBlock(1)
        }
    }
    
    //指导箭头
    lazy var arrowImgView: UIImageView = {
        
        let imgView = UIImageView()
        self.contentView.addSubview(imgView)
        
        imgView.snp.makeConstraints({ (make) in
            make.centerY.equalToSuperview()
            make.right.equalTo(-15)
        })
        return imgView
    }()
    
    public class func identifier() -> String {
        
        let name:AnyClass! = object_getClass(self)
        
        return NSStringFromClass(name)
    }

}
